/*
 * ============================================================================
 *
 *       Filename:  msg.c
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2015年03月04日 18时03分27秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  jianxi sun (jianxi), ycsunjane@gmail.com
 *   Organization:  
 *
 * ============================================================================
 */
#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>

#include "msg.h"
#include "chap.h"
#include "system.h"

void fill_msg_header(struct msg_head_t *msg, int msgtype, 
	char *uuid, uint32_t random)
{
	msg->random = random;
	if(uuid)
		memcpy(&msg->acuuid[0], 
			uuid, UUID_LEN);
	memcpy(&msg->smac[0], 
		&gconf.mac[0], ETH_ALEN);
	msg->msg_type = htonl(msgtype); 
}

